package com.cin.cma.server.biz.dal.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 *
 * </p>
 *
 * @author baomidou
 * @since 2025-03-15
 */
@Getter
@Setter
@ToString
@TableName("TK_SEAT")
@Accessors(chain = true)
@KeySequence("SEQ_SEAT")
public class TkSeatDO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.INPUT)
    private Integer seatid;

    /**
     * 影院编码
     */
    private String cinemaCode;

    /**
     * 分区编码
     */
    private String sectionCode;

    /**
     * 影厅编码
     */
    private String hallCode;

    /**
     * 座位编码
     */
    private String seatCode;

    /**
     * 座位名称
     */
    private String seatName;

    /**
     * 座位行
     */
    private String rowId;

    /**
     * 座位列
     */
    private String columnId;

    /**
     * 屏幕行
     */
    private Integer seatplanX;

    /**
     * 屏幕列
     */
    private Integer seatplanY;

    /**
     * 座位类型
     */
    private String seatType;

    /**
     * 0 未删除 1已删除
     */
    private Integer delFlag;

    private String loveCode;

    private String creator;

    private Date createTime;

    private String modifier;

    private Date modified;

    /**
     * 0 正常 1 维修
     */
    private Integer damagedFlag;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TkSeatDO waitEqTkSeatDO = (TkSeatDO) o;
        return compareKey(waitEqTkSeatDO).equals(compareKey(this));
    }

    @Override
    public int hashCode() {
        return compareKey(this).hashCode();
    }

    private String compareKey(TkSeatDO tkSeatDO) {
        return tkSeatDO.getCinemaCode() +
                tkSeatDO.getSectionCode() +
                tkSeatDO.getHallCode() +
                tkSeatDO.getSeatCode() +
                tkSeatDO.getSeatName() +
                tkSeatDO.getRowId() +
                tkSeatDO.getColumnId() +
                tkSeatDO.getSeatplanX() +
                tkSeatDO.getSeatplanY() +
                tkSeatDO.getSeatType() +
                tkSeatDO.getDelFlag() +
                tkSeatDO.getLoveCode() +
                tkSeatDO.getDamagedFlag();
    }
}
